Attribute VB_Name = "dec"
Public Const BIF_RETURNONLYFSDIRS = 1
Public Const MAX_PATH = 260


Public Type BrowseInfo
     hwndOwner As Long
     pIDLRoot As Long
     pszDisplayName As Long
     lpszTitle As Long
     ulFlags As Long
     lpfnCallback As Long
     lParam As Long
     iImage As Long
End Type
 
 
 
 
  Public Const HKEY_PERFORMANCE_DATA = &H80000004
  Public Const HKEY_CURRENT_CONFIG = &H80000005
  Public Const HKEY_DYN_DATA = &H80000006
    
  Public Const REG_NONE = 0
  Public Const REG_SZ = 1
  Public Const REG_EXPAND_SZ = 2
  Public Const REG_BINARY = 3
  Public Const REG_DWORD = 4
  Public Const REG_DWORD_BIG_ENDIAN = 5
  Public Const REG_MULTI_SZ = 7



Public Declare Function lstrlenW Lib "kernel32" _
  (ByVal lpString As Long) As Long

Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" _
   Alias "RegOpenKeyExA" _
  (ByVal hKey As Long, _
   ByVal lpSubKey As String, _
   ByVal ulOptions As Long, _
   ByVal samDesired As Long, _
   phkResult As Long) As Long

Enum HKEYS
HKEY_CLASSES_ROOT = &H80000000
HKEY_CURRENT_USER = &H80000001
HKEY_LOCAL_MACHINE = &H80000002
HKEY_USERS = &H80000003
End Enum



 
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, _
ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, _
ByVal dwOptions As Long, ByVal samDesired As Long, _
ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, ByRef phkResult As Long, _
ByRef lpdwDisposition As Long) As Long
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, _
ByVal lpSubKey As String) As Long
Public Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, _
ByVal dwIndex As Long, ByVal lpName As String, ByRef lpcbName As Long, _
ByVal lpReserved As Long, ByVal lpClass As String, ByRef lpcbClass As Long, _
lpftLastWriteTime As FILE_TIME) As Long
Public Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, _
ByVal dwIndex As Long, ByVal lpValueName As String, ByRef lpcbValueName As Long, _
ByVal lpReserved As Long, ByRef lpType As Long, ByRef lpData As Any, _
ByRef lpcbData As Long) As Long

Public Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, _
ByVal lpData As String, ByRef lpcbData As Long) As Long
Public Declare Function RegQueryInfoKey Lib "advapi32.dll" Alias "RegQueryInfoKeyA" (ByVal hKey As Long, _
ByVal lpClass As String, ByRef lpcbClass As Long, ByVal lpReserved As Long, _
ByRef lpcSubKeys As Long, ByRef lpcbMaxSubKeyLen As Long, ByRef lpcbMaxClassLen As Long, _
ByRef lpcValues As Long, ByRef lpcbMaxValueNameLen As Long, ByRef lpcbMaxValueLen As Long, _
ByRef lpcbSecurityDescriptor As Long, ByRef lpftLastWriteTime As FILE_TIME) As Long
Public Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, _
ByVal lpValue As String, ByVal cbData As Long) As Long
Public Declare Function RegSetValueExBoolean Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, _
ByRef lpData As Boolean, ByVal cbData As Long) As Long
Public Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, _
ByRef lpValue As Long, ByVal cbData As Long) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long


' Declare Windows API constants...
Public Const lngHKEY_CLASSES_ROOT = &H80000000
Public Const lngHKEY_CURRENT_USER = &H80000001
Public Const lngHKEY_LOCAL_MACHINE = &H80000002
Public Const lngHKEY_USERS = &H80000003

Public Const lngERROR_SUCCESS = 0&
Public Const lngERROR_FAILURE = 13&
Public Const lngUNREADABLE_NODE = 234&
Public Const lngNO_MORE_NODES = 259&
Public Const lngERROR_MORE_DATA = 234&

Public Const lngREG_OPTION_NON_VOLATILE = 0
Public Const lngSYNCHRONIZE = &H100000
Public Const lngSTANDARD_RIGHTS_READ = &H20000
Public Const lngKEY_QUERY_VALUE = &H1
Public Const lngKEY_ENUMERATE_SUB_KEYS = &H8
Public Const lngKEY_NOTIFY = &H10
Public Const lngKEY_SET_VALUE = &H2
Public Const lngKEY_CREATE_SUB_KEY = &H4
Public Const lngKEY_CREATE_LINK = &H20
Public Const lngSTANDARD_RIGHTS_ALL = &H1F0000
Public Const lngKEY_READ = ((lngSTANDARD_RIGHTS_READ Or lngKEY_QUERY_VALUE Or lngKEY_ENUMERATE_SUB_KEYS Or _
lngKEY_NOTIFY) And (Not lngSYNCHRONIZE))
Public Const lngKEY_ALL_ACCESS = ((lngSTANDARD_RIGHTS_ALL Or lngKEY_QUERY_VALUE Or lngKEY_SET_VALUE Or _
lngKEY_CREATE_SUB_KEY Or lngKEY_ENUMERATE_SUB_KEYS Or lngKEY_NOTIFY Or _
lngKEY_CREATE_LINK) And (Not lngSYNCHRONIZE))
Public Const lngREG_SZ = 1
Public Const lngREG_BINARY = 3
Public Const lngREG_DWORD = 4

' Declare Windows API types...
Public Type FILE_TIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
Public totalStep As Integer
Public isNoCloseExcel As Boolean
' Declare necessary API routines:
 
Public Declare Function EndTask Lib "user32" Alias "EndTaskA" (ByVal hwnd As Long, ByVal fShutDown As Boolean, ByVal fForce As Boolean) As Boolean
Public Declare Function CloseWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function SendMessage Lib "user32" _
   Alias "SendMessageA" _
  (ByVal hwnd As Long, _
   ByVal wMsg As Long, _
   ByVal wParam As Long, _
   lParam As Any) As Long

'Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Public Declare Function GetWindow Lib "user32" ( _
ByVal hwnd As Integer, _
ByVal wCmd As Integer) As Integer

Public Declare Function GetWindowLong _
Lib "user32" Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Public Declare Function PostMessage _
Lib "user32" Alias "PostMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

Public Declare Function GetWindowTextLength _
Lib "user32" Alias "GetWindowTextLengthA" ( _
ByVal hwnd As Long) As Long

Public Declare Function GetWindowText _
Lib "user32" Alias "GetWindowTextA" ( _
ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) As Long

Public Declare Function IsWindow Lib "user32" ( _
ByVal hwnd As Integer) As Integer

Public Const NILL = 0&
Public Const WM_SYSCOMMAND = &H112
Public Const SC_CLOSE = &HF060&

Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
Public Const PROCESS_VM_READ = &H10
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2
Public Const GW_OWNER = 4
Public Const GWL_STYLE = -16
Public Const WS_DISABLED = &H8000000
Public Const WS_CANCELMODE = &H1F
Public Const WM_CLOSE = &H10

